In this script we assess whether perturbation indicators are associated with any of the technical covariates.

First we read the results generated by perturbation_propensity.R:

results_file <- paste0(
  .get_config_path("LOCAL_SCEPTRE2_DATA_DIR"),
  "results/perturbation_propensity_analysis/results.rds"
)
results <- readRDS(results_file)
results
## # A tibble: 9,432 × 9
##    paper    dataset  ntc   covariate test_type estimate std_error  zvalue pvalue
##    <chr>    <chr>    <chr> <chr>     <chr>        <dbl>     <dbl>   <dbl>  <dbl>
##  1 frangieh co_cult… ONE-… n_nonzero joint     -1.60e-3 0.00116   -1.38   0.169 
##  2 frangieh co_cult… ONE-… n_umis    joint      2.48e-5 0.0000950  0.260  0.795 
##  3 frangieh co_cult… ONE-… cluster_x joint      2.82e-1 0.239      1.18   0.238 
##  4 frangieh co_cult… ONE-… cluster_y joint      3.62e-1 0.205      1.76   0.0777
##  5 frangieh co_cult… ONE-… s_score   joint     -1.02e-1 1.95      -0.0523 0.958 
##  6 frangieh co_cult… ONE-… g2m_score joint     -2.56e+0 1.47      -1.74   0.0812
##  7 frangieh co_cult… ONE-… phaseG2M  joint      9.58e-1 0.781      1.23   0.220 
##  8 frangieh co_cult… ONE-… phaseS    joint      7.95e-2 0.685      0.116  0.908 
##  9 frangieh co_cult… ONE-… batchB3   joint      6.37e-1 0.631      1.01   0.312 
## 10 frangieh co_cult… ONE-… batchC3   joint     -3.76e-1 0.768     -0.489  0.625 
## # … with 9,422 more rows

Next, for each dataset, we plot the \(p\)-values for each covariate across NTCs: